package cn.finyzq.ss.games.config;

import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import java.util.Properties;

/**
 * Create Time: 2018年02月26日 20:06
 *
 * @author fin
 */
@Configurable
@ComponentScan({"cn.finyzq.ss.games.web.*","cn.finyzq.ss.games.service"})
@PropertySource({"classpath:application.properties"})
public class BysjConfiguration {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }



    /**
     * 分页插件
     * @return 分页插件
     */
    @Bean
    public PageHelper pageHelper(){
        PageHelper pageHelper = new PageHelper();
        Properties p = new Properties();
        p.setProperty("offsetAsPageNum","true");
        p.setProperty("rowBoundsWithCount","true");
        p.setProperty("reasonable","true");
        pageHelper.setProperties(p);
        return pageHelper;
    }


}
